import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)



const routes = [{
    path: '/',
    redirect: '/home',
    meta: {
        title: "首页",
        tabbar:'首页',

    },
}, 	{
    path: '/home',
    component: require('../view/sthj/home.vue').default,
    meta: {
        title: "首页",
        tabbar:'首页',

    },
},
{
path: '/sthj',
component: require('../view/sthj/sthj/sthj.vue').default,
meta: {
    title: "生态环境",
    tabbar: "生态环境",
},

},
{
path: '/kqzl',
component: require('../view/sthj/kqzl/kqzl.vue').default,
meta: {
    title: "空气质量",
    tabbar: "空气质量",
},
},
{
    path: '/tdhj',
    component: require('../view/sthj/tdhj/tdhj.vue').default,
    meta: {
        title: "土地质量",
        tabbar: "土地质量",
    },
    },
    {
        path: '/shj',
        component: require('../view/sthj/shj/shj.vue').default,
        meta: {
            title: "水环境质量",
            tabbar: "水环境质量",
        },
    },
    {
        path: '/sthjzlbg',
      
        component: require('../view/sthj/sthj/zlbg/zlbg.vue').default,
        meta: {
            title: "生态环境质量报告",
       
        },
    },
    {
        path: '/shjzlbg',
        component: require('../view/sthj/shj/zlbg/zlbg.vue').default,
        meta: {
            title: "水环境质量报告",
        },
    },
    {
        path: '/tdhjzlbg',
        component: require('../view/sthj/tdhj/zlbg/zlbg.vue').default,
        meta: {
            title: "土地环境质量报告",
        },
    },
    {
        path: '/kqzlzlbg',
        component: require('../view/sthj/kqzl/zlbg/zlbg.vue').default,
        meta: {
            title: "空气质量报告",
        },
    },
    {
        path:'/wzxq',
        name:'wzxq',
        component: require('../view/sthj/articleDetail/wzxq.vue').default,
        meta: {
            title: "文章详情",
        },
    }
]

const router = new VueRouter({
    routes,
    mode: 'history',
    base: "/hcsthj/",
})


router.beforeEach((to, from, next) => {
    document.title = to.matched[0].meta.title;
    next()
})


router.afterEach((to, from, next) => {
    window.scrollTo(0, 0);
    next;
});


export default router